package com.tueye.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @author yue descript: the topic'type like "美女PK"
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "tueye_topic_type")
public class TopicType extends BaseEntity {

	private String type_name;
	// for create folds
	private String type_enlish_name;

	private String type_page_title;
	private String type_page_keywords;
	private String type_page_description;
	private Integer isleaf;//是否有有子节点 0 是没有，1是有子节点
	private String pid;//父亲id
	//private List<TopicType> childTopicTypeList;
	// add by yuyue 09/11/1
	//private TopicType pTopicType; // 自连接做多级
	private List<KeyWords> tags; // 此类型下的标签
	private List<ArticleTopic> articleTopic = new ArrayList<ArticleTopic>(); // 类型下的专题
	private List<Topics> topics = new ArrayList<Topics>();

	public String getType_name() {
		return type_name;
	}

	public void setType_name(String type_name) {
		this.type_name = type_name;
	}

	public String getType_enlish_name() {
		return type_enlish_name;
	}

	public void setType_enlish_name(String type_enlish_name) {
		this.type_enlish_name = type_enlish_name;
	}

	@OneToMany(mappedBy = "topic_type", cascade = CascadeType.ALL)
	public List<Topics> getTopics() {
		return topics;
	}

	public void setTopics(List<Topics> topics) {
		this.topics = topics;
	}

	public String getType_page_title() {
		return type_page_title;
	}

	public void setType_page_title(String type_page_title) {
		this.type_page_title = type_page_title;
	}

	public String getType_page_keywords() {
		return type_page_keywords;
	}

	public void setType_page_keywords(String type_page_keywords) {
		this.type_page_keywords = type_page_keywords;
	}

	public String getType_page_description() {
		return type_page_description;
	}

	public void setType_page_description(String type_page_description) {
		this.type_page_description = type_page_description;
	}
	
	
	/*@ManyToOne(targetEntity = TopicType.class, fetch = FetchType.LAZY) 
	@JoinColumn(name = "pTopicType_id",updatable=false) 
	public TopicType getPTopicType() {
		return pTopicType;
	}

	public void setPTopicType(TopicType topicType) {
		pTopicType = topicType;
	}*/

	@OneToMany(mappedBy = "topicType", cascade = CascadeType.ALL)
	public List<KeyWords> getTags() {
		return tags;
	}

	public void setTags(List<KeyWords> tags) {
		this.tags = tags;
	}

	@OneToMany(mappedBy = "topicType", cascade = CascadeType.ALL)
	public List<ArticleTopic> getArticleTopic() {
		return articleTopic;
	}

	public void setArticleTopic(List<ArticleTopic> articleTopic) {
		this.articleTopic = articleTopic;
	}

	public Integer getIsleaf() {
		return isleaf;
	}

	public void setIsleaf(Integer isleaf) {
		this.isleaf = isleaf;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	/*@OneToMany(targetEntity = TopicType.class,  fetch = FetchType.LAZY, mappedBy = "childTopicTypeList") 
	//@OneToMany(mappedBy = "pTopicType", cascade = CascadeType.ALL)
	@JoinColumn(name = "pTopicType_id")
	public List<TopicType> getChildTopicTypeList() {
		return childTopicTypeList;
	}

	public void setChildTopicTypeList(List<TopicType> childTopicTypeList) {
		this.childTopicTypeList = childTopicTypeList;
	}
	*/
	
	
	
}